package com.example.fengyuwuzu2.http.repository;

import com.example.fengyuwuzu2.http.service.NewsService;

import retrofit2.Retrofit;
import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

public class NewsRepository {
    public static final String NEWS_BASE_URL = "http://v.juhe.cn/";
    public static final String KEY = "1242f2c4f048a4fc8da846f0fca69e0a";
    private final NewsService mNewsService;
    public NewsRepository() {
        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(NEWS_BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava3CallAdapterFactory.create())
                .build();
        mNewsService = retrofit.create(NewsService.class);
    }
}
